BasinDelineate Subroutine

public subroutine BasinDelineate(fdir, x, y, mask)

compute mask of river basin given map of flow direction and the coordinate of the outlet point

Arguments

Type IntentOptional Attributes Name
type(grid_integer), intent(in) :: fdir
real(kind=float), intent(in) :: x

coordinate of outlet

real(kind=float), intent(in) :: y

coordinate of outlet

type(grid_integer), intent(inout) :: mask

Variables

Type Visibility Attributes Name Initial
logical, public :: check
integer, public :: i
integer, public :: j

Source Code

SUBROUTINE BasinDelineate &
!
(fdir,x,y, mask)

IMPLICIT NONE

!arguments with intent in
TYPE(grid_integer), INTENT(in):: fdir
REAL (KIND = float), INTENT(in) :: x, y !!coordinate of outlet

!arguments with intent inout:
TYPE(grid_integer), INTENT(inout) :: mask

!local variables
INTEGER :: i,j
LOGICAL :: check

!------------------------------end of declaration -----------------------------
                                         
IF (.NOT. ALLOCATED (mask % mat)) THEN
  !allocate new grid
  CALL NewGrid (mask, fdir)
END IF

mask % mat = mask % nodata

!compute row and column of outlet
CALL GetIJ (x, y, fdir, i, j, check)
	
!compute basin mask
CALL BasinMask(mask,fdir,i,j)

END SUBROUTINE BasinDelineate